﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Org.SpmisFramework.Protocols
{
    /// <summary>
    /// 简单结果数据包装
    /// </summary>
    [Serializable]
    public class SimpleResult : IResult
    {
        private int _errorCode;
        private string _errorMsg;

        /// <summary>
        /// 错误编码
        /// </summary>
        public int ErrorCode
        {
            get { return _errorCode; }
            set { _errorCode = value; }
        }

        /// <summary>
        /// 错误信息（可选参数）
        /// </summary>
        public string ErrorMsg
        {
            get { return _errorMsg; }
            set { _errorMsg = value; }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public SimpleResult()
        { }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="errorCode">错误编码</param>
        public SimpleResult(int errorCode)
        {
            this._errorCode = errorCode;
            this._errorMsg = "";
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="errorCode">错误编码</param>
        /// <param name="errorMsg">错误信息</param>
        public SimpleResult(int errorCode, string errorMsg)
        {
            this._errorCode = errorCode;
            this._errorMsg = errorMsg;
        }
    }
}
